<template>
  <h1>搜索关键字：{{ val }}</h1>
</template>

<script>
import emitter from './event'
export default {
  data() {
    return {
      val: ''
    }
  },
  methods: {
    serachCb(data) {
      this.val = data
    }
  },
  mounted() {
    emitter.$on('xx', this.serachCb)
  }
}
</script>

<style></style>
